package com.wiscamp.ninechapters.tags.application.assemblers;

import com.wiscamp.ninechapters.tags.application.dto.command.CreateTagCommand;
import com.wiscamp.ninechapters.tags.application.dto.command.UpdateTagCommand;
import com.wiscamp.ninechapters.tags.application.dto.vo.TagGroupVO;
import com.wiscamp.ninechapters.tags.application.dto.vo.TagNameVO;
import com.wiscamp.ninechapters.tags.application.dto.vo.TagVO;
import com.wiscamp.ninechapters.tags.domain.models.Tag;
import com.wiscamp.ninechapters.tags.domain.models.TagGroup;
import jakarta.validation.constraints.NotNull;
import org.mapstruct.Mapper;
import org.mapstruct.NullValueCheckStrategy;
import org.mapstruct.NullValuePropertyMappingStrategy;
import org.mapstruct.ReportingPolicy;
import org.mapstruct.factory.Mappers;

@Mapper(componentModel = "spring",
        unmappedTargetPolicy = ReportingPolicy.IGNORE,
        unmappedSourcePolicy = ReportingPolicy.IGNORE,
        nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE,
        nullValueCheckStrategy = NullValueCheckStrategy.ALWAYS)
public interface TagAssembler {
    TagAssembler Instance = Mappers.getMapper(TagAssembler.class);

    TagVO toTagVO(@NotNull Tag entity);

    TagNameVO toSimpleTagVO(@NotNull Tag entity);

    Tag toTag(@NotNull CreateTagCommand createCommand);

    Tag toTag(@NotNull UpdateTagCommand updateCommand);


    TagGroupVO toTagGroupVO(@NotNull TagGroup entity);
}
